﻿using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using PMS.Web.Framework.Mvc.Routing;
using System;
using System.Collections.Generic;
using System.Text;

namespace PMS.Plugin.ExternalAuth.DingTalkScan.Infrastructure
{
    public partial class DingTalkScanPluginRouteProvider : IRouteProvider
    {
        #region Methods

        /// <summary>
        /// Register routes
        /// </summary>
        /// <param name="endpointRouteBuilder">Route builder</param>
        public void RegisterRoutes(IEndpointRouteBuilder endpointRouteBuilder)
        {
            endpointRouteBuilder.MapControllerRoute("DingTalkScanAuthorization", "/oath2/dingtalkscan/authorization",
                new { controller = "DingTalkScanAuthentication", action = "Authorization" });
            //LoginCallBack
            endpointRouteBuilder.MapControllerRoute("DingTalkScanCallback", "/oath2/dingtalkscan/callback",
                new { controller = "DingTalkScanAuthentication", action = "DingTalkScanCallback" });
        }

        #endregion

        #region Properties

        /// <summary>
        /// Gets a priority of route provider
        /// </summary>
        public int Priority => 101;

        #endregion

    }
}
